<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Symbol内置属性</title>
</head>
<body>
    <script>
        class Person {
            //此功能在进行instanceof时自动触发
            static [Symbol.hasInstance](param) {
                console.log(param);
                console.log("我被用来检测类型");
                return true; //此处如果返回true,结果就是true,此处如果返回false,结果就是false
            }
        }

        let o = {};
        console.log(o instanceof Person);



        const arr = [1, 2, 3];
        const arr2 = [4, 5, 6];
        //表示值不可展开，整个数组作为一个值合并
        arr2[Symbol.isConcatSpreadable] = false;
        console.log(arr.concat(arr2));
    </script>
</body>
</html>